/*
注意！
此类已经废除，本来用来读取osu文件里的音频文件名和打击时序的
由于出现乱码问题，此类已被我抛弃
所以在此不作注释
大家请自行理解
 */

package IO;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class BeatMapReader {
    public String path;
    public FileReader fr;
    public File pathFile;
    public BeatMapReader(String path) throws FileNotFoundException {
        this.path=path;
        this.pathFile=new File(path);
        this.fr = new FileReader(pathFile);
    }
    public String read() throws IOException {  //获取不格式化的文本,其实两个一样
        char[] c = new char[(int)pathFile.length()];
        fr.read(c);
        return String.valueOf(c);
    }

    public String readAndFormart() throws IOException {
        char[] c = new char[(int)pathFile.length()]; //获取格式化前的文本,其实两个一样
        fr.read(c);
         String beforeFormat = String.valueOf(c);
        return beforeFormat;
    }
    public String getMusicPath() throws IOException {
        String s = read();
        String musicPath = s.split("\n")[0];
       // System.out.println(musicPath);
        return musicPath;
    }

}
